package com.nbsaas.boot.store.rest.convert;

import com.nbsaas.boot.store.data.entity.StoreCheckIn;
import com.nbsaas.boot.store.api.domain.request.StoreCheckInRequest;

import org.springframework.beans.BeanUtils;
import com.nbsaas.boot.rest.api.Converter;
import com.nbsaas.boot.utils.BeanDataUtils;
            import com.nbsaas.boot.store.data.entity.Store;

/**
* 请求对象转换成实体对象
*/

public class StoreCheckInEntityConvert  implements Converter<StoreCheckIn, StoreCheckInRequest> {

    @Override
    public StoreCheckIn convert(StoreCheckInRequest source) {
        StoreCheckIn result = new StoreCheckIn();
        BeanDataUtils.copyProperties(source, result);
                    if(source.getStore()!=null){
                    Store store =new Store();
                    store.setId(source.getStore());
                    result.setStore(store);
                    }
        return result;
    }
}

